package com.czkj.hwz.decorate.fragment;

import android.os.Bundle;
import android.widget.ListView;

import com.czkj.hwz.decorate.R;
import com.czkj.hwz.decorate.adapter.MessageAdapter;
import com.king.base.BaseFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * 作者：lxm on 2017/11/13 13:19
 * 邮箱：18014168291@189.cn
 * 消息fragment
 */
public class MessageFragment extends BaseFragment {
    private ListView lv;
    private List<String> stringList;
    private MessageAdapter messageAdapter;
    @Override
    public int inflaterRootView() {
        return R.layout.fragment_message;
    }

    public static MessageFragment newInstance() {

        Bundle args = new Bundle();
        
        MessageFragment fragment = new MessageFragment();
        fragment.setArguments(args);
        return fragment;
    }
    @Override
    public void initUI() {
        lv=findView(R.id.lv);
    }

    @Override
    public void initData() {
        stringList=new ArrayList<>();
        for (int i=0;i<10;i++) {
            String str = (i % 2 == 0)?"客户服务":"取货通知";
            stringList.add(str);
        }
        messageAdapter=new MessageAdapter(context,stringList);
        lv.setAdapter(messageAdapter);
    }

    @Override
    public void addListeners() {
    }

}
